function $$(classname)
{
    return document.getElementsByClassName(classname);
}
function $$$(tagname)
{
    return document.getElementsByTagName(tagname);
}
function myCheckPassword()
{
    var temp = document.getElementsByName("password")[1].value;
    if(temp.length===0)
    {
        //alert(temp.length);
        $$("tip")[0].style.visibility="hidden";
        $$("OK")[0].style.visibility="hidden";
        $$$("input")[1].style.border="";
        $$$("input")[1].style.borderColor="";
    }
    else if (temp.length < 6)
    {
        $$("tip")[0].style.visibility="visible";
        $$$("input")[1].style.border="1px solid";
        $$$("input")[1].style.borderColor="red";
    }
    else
    {
        var flag1=0,flag2=0,flag3=0;
        for(var i=0;i<temp.length;i++)
        {
            if(temp[i]>='0'&&temp[i]<='9')
            {
                flag1=1;
            }
            else if((temp[i]>='a'&&temp[i]<='z')||(temp[i]>='A'&&temp[i]<='Z'))
            {
                flag2=1;
            }
            else if(temp[i]!==' ')
            {
                flag3=1;
            }
        }
        if(flag1===0||flag2===0||flag3===0)
        {
            $$("tip")[0].style.visibility="visible";
            $$$("input")[1].style.border="1px solid";
            $$$("input")[1].style.borderColor="red";
        }
        else
        {
            $$("tip")[0].style.visibility="hidden";
            $$("OK")[0].style.visibility="visible";
            $$$("input")[1].style.border="";
            $$$("input")[1].style.borderColor="";
        }
    }
}
function myCheckPasswordAgain()
{
    var str1=document.getElementsByName("password")[1].value;
    var str2=document.getElementsByName("again_password")[0].value;
    if(str2.length===0)
    {
        //alert(temp.length);
        $$("tip")[1].style.visibility="hidden";
        $$("OK")[1].style.visibility="hidden";
        $$$("input")[2].style.border="";
        $$$("input")[2].style.borderColor="";
    }
    else if(str1!==str2)
    {
        $$("tip")[1].style.visibility="visible";
        $$$("input")[2].style.border="1px solid";
        $$$("input")[2].style.borderColor="red";
    }
    else
    {
        $$("tip")[1].style.visibility="hidden";
        $$("OK")[1].style.visibility="visible";
        $$$("input")[2].style.border="";
        $$$("input")[2].style.borderColor="";
    }
}